home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
bbs
/
doorinfo.zip
/
DOORUTIL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-14
|
7KB
|
265 lines
/*
**
** Prototype list for DOORUTIL.H
**
*/
#include "structs.h"
#include "bbscfg.h"
struct msg3
{
int type; /* will always be 7 */
int line; /* the line number for this task (0-5) */
int inq; /* the queue to read incoming data from */
int outq; /* the queue to send outgoing data to */
struct acct_rec far *acctptr; /* a pointer to an array of structures */
struct user_rec far *userptr;
int numlines; /* how many lines are configured */
struct cfg_rec far *cfgptr; /* pointer to BBSCFG record */
};
struct msg1
{
int type;
int count;
char text[1200];
};
struct msg7
{
int type;
int line;
int count;
char text[80];
};
struct msg4
{
int type;
int oba; /* how many bytes available in output buffer */
int count; /* how many bytes currently in output buffer */
};
/*
** Thsi structure is used for broadcast to multiple lines
*/
struct msg5
{
int type;
char far *text;
int far *flag;
int sendto[65];
int tcbnum;
};
struct msg6
{
int m6type;
int m6line;
int m6msgnum;
int m6ansiflag;
int m6tcbnum;
char far *m6text;
int far *m6flag;
};
/*
** cbr is a structure used when making database calls to Falken.
** Doors have the ability to manipulate Falkens databases, but
** must call Falken to do it. This structure is set up for the
** database call, and then the address of this structure is passed
** to Falken in the mdbs structure below.
*/
#define MAXKEY 32
typedef struct /* entry structure in index */
{
unsigned long recptr; /* points to data record */
int reclen; /* Record length */
char key[MAXKEY]; /* start of record key */
} ENTRY;
struct call_bt_rec
{
int bt_function;
int bt_file_id; /* an index into the IX_DESC array */
void far *data_addr;
int far *length;
ENTRY far *data_key;
int keynumber; /* must be 0 */
int rtnvalue; /* to be loaded with the return value */
};
struct mdbs_rec
{
int mdbs_type;
struct call_bt_rec far *cbraddr;
int tcbnum;
int far *doneflag;
};
extern unsigned char workbuf[];
extern int inq, outq, who, numlines; /* see header comments above */
extern struct acct_rec far *acct;
extern struct user_rec far *user;
extern struct cfg_rec far *cfg; /* pointer to BBSCFG record */
/*
** acct and user are useful, giving us the address of the structure arrays.
** for simplified access, though, we will set up a pointer to OUR
** element in the array.
**
** myacct-> will be the account record for the current user
** myuser-> will be the user record for the current user
*/
extern struct acct_rec far *myacct;
extern struct user_rec far *myuser;
extern int Mytcbnum;
extern struct msg3 m3;
extern struct msg1 *m1;
extern struct msg4 *m4;
extern struct msg5 *m5;
extern struct msg6 *m6;
extern struct msg7 *m7;
extern int init(void);
extern void logoff(int);
extern void setbinarymode(int);
extern void settextmode(int);
extern void clear_input_buffer(int);
extern void clear_output_buffer(int);
extern void get_port(int port);
extern void return_port(int port);
extern int get_oba(void);
extern int get_in_cnt(void);
extern int bbslog(char *fs);
extern int qprintf(char *fs,...);
extern int qputs(char *fs);
extern int send(char *fs);
extern int sendtoline(int w, char *fs);
extern void broadcast(char *fs,int *linenums);
extern void sendmsg(int who, int msgnum);
extern void getmsg(int ansiflag, int msgnum, char *fs);
extern int qgets(char *s, int len);
extern int tqgets(char *s, int len, int timeout);
extern void waitforempty(void);
extern int getserialnum(char *s);
extern int getversion(char *s);
extern void btupag(int lines);
extern void setwatchdog(int line, int value);
extern void btuech(int echoval);
extern int find_account(char *s1, void *mem);
extern int start_a_door(char *cmd, int pri);
extern void wait_for_door(int tcbnum);
extern int load_a_door(char *cmd, int pri);
extern void save_acct(void);
extern int sendtoq(char *fs, int qnum);
void sendraw (int port, unsigned char *buf, int count);
extern int btrv(int fcode, int fd, void *datbuf, int *size,
ENTRY * key, int keynum);
/*
** FOSSIL function prototypes
*/
int f_ovrunerrs(int);
int f_recv(int, char *, int);
int f_send(int, char *, int);
int f_getinfo(int, void *, int);
int f_status(int);
int f_setbaud(int,unsigned int);
int f_initialize(int);
int f_dtr(int,int);
int f_flushin(int);
int f_flushout(int);
int f_getfc(int);
int f_flowctrl(int, int);
int f_purgeout(int);
int f_deinit(int);
int f_writechar(int,int);
int f_readchar(int);
int f_defline(int,int,int,int);
int f_getioport(void *);
int f_kill(void);
int f_setbufsize(int, int, int);
int f_getmaxbuf(void);
int f_setmonline(int);
int f_readmonbuf(void *);
int f_insertchar(int,int);
int f_lock(int,int);
int f_getoba(int);
int f_getibw(int);
#define ACCT_FILE 0
#define DLOAD_FILE 1
#define BIOS_FILE 2
#define MSG_FILE 3
#define EMAIL_FILE 4
#define ACCT_NUM_FILE 5
#ifndef EOF
#define EOF (-1)
#endif
#ifndef ERROR
#define ERROR (-1)
#endif
#ifndef OK
#define OK 1
#endif
#define FOUND 2
#define NOTFOUND 3
/*
beginning of index and end of index status codes
*/
#define BOI (-2) /* beginning of index */
#define EOI (-3) /* end of index */
/*
** The following values are legal for fcode
*/
#define b_open 0 /* open an existing database file */
#define b_close 1 /* close a database file */
#define b_insert 2 /* insert a record into the database */
#define b_update 3 /* update (modify) an existing record */
#define b_delete 4 /* delete a record */
#define b_getequ 5 /* get the record whose key exactly equals
* 'key' */
#define b_getnext 6 /* get next record, sequentially */
#define b_getprev 7 /* get previous record */
#define b_getgt 8 /* get record whose key > 'key' */
#define b_getge 9 /* get record whose key >= 'key' */
#define b_getlt 10 /* get record whose key < 'key' */
#define b_getle 11 /* get record whose key <= 'key' */
#define b_getlow 12 /* return first record in database */
#define b_gethi 13 /* return last record in database */
#define b_getpos 14 /* UNUSED */
#define b_getdirect 15 /* return this exact record - key and offset */
#define b_getdata 16 /* special case - only read data file at this
* offset! */
#define b_append 17 /* only write to the data file - return
* offset in key */
#define b_create 21 /* create a new index file */